package com.huqing.icu.enums.user;

import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

/**
 * 活跃用户数量面板类型
 *
 * @author huqing
 * @date 2025-09-04 10:57:49
 */
@Getter
public enum UserNumPanelTypeEnum {

    DAILY(10, "日"),

    MONTH(20, "月"),

    YEAR(30, "年"),

    ;

    private Integer code;

    private String msg;

    UserNumPanelTypeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static UserNumPanelTypeEnum of(int code) {
        for (UserNumPanelTypeEnum categoryEnum : values()) {
            if (categoryEnum.code.equals(code)) {
                return categoryEnum;
            }
        }
        return null;
    }

    public static List<Integer> getAllCode() {
        List<Integer> list = new ArrayList<>();
        for (UserNumPanelTypeEnum typeEnum : values()) {
            list.add(typeEnum.code);
        }
        return list;
    }
}
